package com.px.pa.modulars.circle.controller;

import com.px.basic.alone.security.job.DelayQueueManager;
import com.px.pa.modulars.circle.service.CircleActivitySignService;
import com.px.pa.modulars.job.impl.OrderTaskActuator;
import com.px.pa.modulars.job.impl.OrderTaskParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
@Component
public class OrderJobFactory {

    @Autowired
    private DelayQueueManager queueManager;
    @Resource
    private CircleActivitySignService circleActivitySignService;

    /**
     * 创建延时任务
     * @param param
     * @param expire
     */
    public void createJob(OrderTaskParam param, long expire){
        OrderTaskActuator task=new OrderTaskActuator(param,expire,this.circleActivitySignService);
        this.queueManager.put(task);
    }
}
